package api_.collectionTest.genericstest;


import sun.management.HotspotClassLoadingMBean;

class Box<T>
{
    private T width;
    private T length;

    public T getWidth()
    {
        return width;
    }

    public void setWidth(T width)
    {
        this.width = width;
    }

    public T getLength()
    {
        return length;
    }

    public void setLength(T length)
    {
        this.length = length;
    }
}

class PrintUntil
{
    // 静态方法的 写在返回值类型之前
    public static <T> void printArray(T[] arr)
    {
        for (T t: arr)
        {
            System.out.println(t);
        }
    }
}


public class demo1
{
    public static void main(String[] args)
    {
        Box<Integer> box = new Box<>();
        box.setLength(11);
        box.setWidth(11);
        System.out.println("area = " + box.getLength() * box.getWidth());

        String[] strs = {"1","2","3"};
        PrintUntil.printArray(strs);

    }
}
